/*
 * Created by JFormDesigner on Mon Apr 10 14:21:24 CST 2023
 */

package com.canteen.gui.ordersearchform;

import java.awt.*;
import javax.swing.*;
import javax.swing.table.*;

/**
 * @author s303teacher
 */
public class OrderSearchForm extends JFrame {
    public OrderSearchForm() {
        initComponents();
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents  @formatter:off
        orderIdLabel = new JLabel();
        orderIdInput = new JTextField();
        phoneLabel = new JLabel();
        phoneInput = new JTextField();
        orderTimeLabel = new JLabel();
        orderTimeInput = new JSpinner();
        customerNameLabel = new JLabel();
        customerNameInput = new JTextField();
        orderAddressLabel = new JLabel();
        orderAddressInput = new JTextField();
        orderSearchButton = new JButton();
        orderInformationLabel = new JLabel();
        scrollPane1 = new JScrollPane();
        orderInformationTable = new JTable();
        orderComboLabel = new JLabel();
        scrollPane2 = new JScrollPane();
        orderComboList = new JList();
        printOrderButton = new JButton();
        printerSettingButton = new JButton();

        //======== this ========
        setResizable(false);
        setTitle("\u8ba2\u5355\u67e5\u8be2");
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        var contentPane = getContentPane();
        contentPane.setLayout(null);

        //---- orderIdLabel ----
        orderIdLabel.setText("\u8ba2\u5355\u53f7\uff1a");
        contentPane.add(orderIdLabel);
        orderIdLabel.setBounds(45, 35, 65, 30);
        contentPane.add(orderIdInput);
        orderIdInput.setBounds(105, 35, 160, 30);

        //---- phoneLabel ----
        phoneLabel.setText("\u624b\u673a\u53f7\uff1a");
        contentPane.add(phoneLabel);
        phoneLabel.setBounds(295, 35, 65, 30);
        contentPane.add(phoneInput);
        phoneInput.setBounds(355, 35, 160, 30);

        //---- orderTimeLabel ----
        orderTimeLabel.setText("\u8ba2\u5355\u65f6\u95f4\uff1a");
        contentPane.add(orderTimeLabel);
        orderTimeLabel.setBounds(550, 35, 65, 30);

        //---- orderTimeInput ----
        orderTimeInput.setModel(new SpinnerDateModel());
        contentPane.add(orderTimeInput);
        orderTimeInput.setBounds(620, 35, 145, 30);

        //---- customerNameLabel ----
        customerNameLabel.setText("\u987e\u5ba2\u59d3\u540d\uff1a");
        contentPane.add(customerNameLabel);
        customerNameLabel.setBounds(35, 75, 65, 30);
        contentPane.add(customerNameInput);
        customerNameInput.setBounds(105, 75, 160, 30);

        //---- orderAddressLabel ----
        orderAddressLabel.setText("\u987e\u5ba2\u5730\u5740\uff1a");
        contentPane.add(orderAddressLabel);
        orderAddressLabel.setBounds(285, 75, 65, 30);
        contentPane.add(orderAddressInput);
        orderAddressInput.setBounds(355, 75, 410, 30);

        //---- orderSearchButton ----
        orderSearchButton.setText("\u8ba2\u5355\u67e5\u8be2");
        contentPane.add(orderSearchButton);
        orderSearchButton.setBounds(635, 125, 130, orderSearchButton.getPreferredSize().height);

        //---- orderInformationLabel ----
        orderInformationLabel.setText("\u8ba2\u5355\u4fe1\u606f\uff1a");
        contentPane.add(orderInformationLabel);
        orderInformationLabel.setBounds(30, 155, 65, 30);

        //======== scrollPane1 ========
        {

            //---- orderInformationTable ----
            orderInformationTable.setModel(new DefaultTableModel(
                new Object[][] {
                    {null, null, null, null, null, null},
                    {null, null, null, null, null, null},
                },
                new String[] {
                    "\u5e8f\u53f7", "\u8ba2\u5355\u53f7", "\u59d3\u540d", "\u624b\u673a", "\u4efd\u6570", "\u521b\u5efa\u65f6\u95f4"
                }
            ));
            {
                TableColumnModel cm = orderInformationTable.getColumnModel();
                cm.getColumn(0).setPreferredWidth(50);
            }
            scrollPane1.setViewportView(orderInformationTable);
        }
        contentPane.add(scrollPane1);
        scrollPane1.setBounds(30, 195, 450, 215);

        //---- orderComboLabel ----
        orderComboLabel.setText("\u8ba2\u5355\u5957\u9910\u8be6\u60c5\uff1a");
        contentPane.add(orderComboLabel);
        orderComboLabel.setBounds(505, 160, 90, 30);

        //======== scrollPane2 ========
        {
            scrollPane2.setViewportView(orderComboList);
        }
        contentPane.add(scrollPane2);
        scrollPane2.setBounds(505, 195, 260, 215);

        //---- printOrderButton ----
        printOrderButton.setText("\u8ba2\u5355\u6253\u5370");
        contentPane.add(printOrderButton);
        printOrderButton.setBounds(280, 425, 90, 30);

        //---- printerSettingButton ----
        printerSettingButton.setText("\u6253\u5370\u8bbe\u7f6e");
        contentPane.add(printerSettingButton);
        printerSettingButton.setBounds(385, 425, 90, 28);

        {
            // compute preferred size
            Dimension preferredSize = new Dimension();
            for(int i = 0; i < contentPane.getComponentCount(); i++) {
                Rectangle bounds = contentPane.getComponent(i).getBounds();
                preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
            }
            Insets insets = contentPane.getInsets();
            preferredSize.width += insets.right;
            preferredSize.height += insets.bottom;
            contentPane.setMinimumSize(preferredSize);
            contentPane.setPreferredSize(preferredSize);
        }
        setSize(805, 510);
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents  @formatter:on
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off
    private JLabel orderIdLabel;
    private JTextField orderIdInput;
    private JLabel phoneLabel;
    private JTextField phoneInput;
    private JLabel orderTimeLabel;
    private JSpinner orderTimeInput;
    private JLabel customerNameLabel;
    private JTextField customerNameInput;
    private JLabel orderAddressLabel;
    private JTextField orderAddressInput;
    private JButton orderSearchButton;
    private JLabel orderInformationLabel;
    private JScrollPane scrollPane1;
    private JTable orderInformationTable;
    private JLabel orderComboLabel;
    private JScrollPane scrollPane2;
    private JList orderComboList;
    private JButton printOrderButton;
    private JButton printerSettingButton;
    // JFormDesigner - End of variables declaration  //GEN-END:variables  @formatter:on
}
